package org.wms.minbearwcs.dao.config.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import org.wms.minbearwcs.dao.config.inf.HttpConfigDao;
import org.wms.minbearwcs.entity.Mapper.config.HttpConfigMapper;
import org.wms.minbearwcs.entity.PO.config.HttpConfig;

@Repository
@RequiredArgsConstructor
public class HttpConfigDaoImpl implements HttpConfigDao {

    private final HttpConfigMapper mapper;

    @Override
    public String selectByHttpName(String name) {
        return new LambdaQueryChainWrapper<>(mapper)
                .eq(HttpConfig::getConfigName,name)
                .select(HttpConfig::getHttpUrl)
                .one()
                .getHttpUrl();
    }
}
